package com.unknowpupil.design.iterator;

/**
 * @Description: <p>
 *
 * </p>
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/4/28 13:32
 * @Classname: Client
 * @Version: 1.0
 */
public class Client {
    public static void main(String[] args) {
        //创建聚合对象
        ConcreteMyAggregate cma = new ConcreteMyAggregate();
        cma.addObject("aa");
        cma.addObject("bb");
        cma.addObject("cc");

        MyIterator iter = cma.createIterator();
        while (iter.hasNext()){
            System.out.println(iter.getCurrentObj());
            iter.next();
        }
    }
}
